import {defineStore} from 'pinia'
import {getProduct,getUser} from '../API/homeAPI'

export const useTotle = defineStore('useTotle',{
    state:() =>{
        return {
            product:'',
            user:''
        }
    },
    getters:{

    },
    actions:{
        async handleGetProduct() {
            const res = await getProduct()
            console.log('商品：',res);
            this.product = res.data
        },
        async handleGetUser() {
            const res = await getUser()
            console.log('用户',res);
            this.user =  res.data
        }
    }
})